package edu.bu.grocerylist.service;

import java.util.List;

import edu.bu.grocerylist.model.GroceryUser;

public interface IGroceryUserService {

	/**
	 * Retrieves all users
	 * @return
	 */
	public List<GroceryUser> getAllUsers();
	
	/**
	 * Logs the user into the system
	 * @param username
	 * @param password
	 * @return The object representing the logged in user
	 */
	public GroceryUser login(String username, String password);
	
	/**
	 * Registers the grocery user into the system, performs check that user does
	 * not already exist
	 * @param userToRegister The user trying to register
	 * @return The newly registered user
	 */
	public GroceryUser registerUser(GroceryUser userToRegister);
	
	/**
	 * Updates the users password and saves it to the database
	 * @param user The user to update
	 * @param newPassword The new password
	 * @return The updated user object
	 */
	public GroceryUser updatePassword(GroceryUser user, String newPassword);
	
	/**
	 * Retrieves the User from the database, this is for answering the security question, so we blank the password
	 * @param userId The userId to get
	 * @return The user object, null if not found
	 */
	public GroceryUser getUserSecurityQuestion(String userId);
	
	/**
	 * Deletes the user, and all of their information from the system
	 * @param userToDelete The user to delete
	 */
	public void deleteUserFromSystem(GroceryUser userToDelete);

}